package com.lagou.ipersistence.executor;

import com.lagou.ipersistence.mapping.BoundSql;
import com.lagou.ipersistence.mapping.MappedStatement;
import com.lagou.ipersistence.session.Configuration;
import com.lagou.ipersistence.session.ResultHandler;
import com.lagou.ipersistence.session.RowBounds;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * @author Yan Jiahong
 * Created 2020/11/8
 */
public interface Executor {
    ResultHandler<?> NO_RESULT_HANDLER = null;
    
    <E> List<E> query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler<?> resultHandler)
            throws SQLException;
    
    <E> List<E> query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler<?> resultHandler,
                      BoundSql boundSql) throws SQLException;
    
    int update(MappedStatement ms, Object parameter) throws SQLException;
    
    void commit() throws SQLException;
    
    void close() throws SQLException;
}
